#define _CRT_SECURE_NO_WARNINGS 1

#include<stdio.h>

typedef struct student
{
	char number[6];
	char name[10];
	unsigned int score;
}Stu;

int main()
{
	int n = 0;
	scanf("%d", &n);
	int i = 0;
	Stu students[10];
	double mid = 0.0;
	for (i = 0;i < n;i++)
	{
		scanf("%s %s %u", students[i].number, students[i].name, &students[i].score);
		mid += students[i].score;
	}
	mid = (double)mid / (double)n;
	printf("%.2lf\n", mid);
	for(i=0;i<n;i++)
		if (students[i].score < mid)
		{
			printf("%s %s\n", students[i].name, students[i].number);
		}
	return 0;
}